package zzxkj.blog.search.mq.handler;

import io.lettuce.core.dynamic.annotation.Command;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import zzxkj.blog.config.RabbitConfig;
import zzxkj.blog.search.mq.entity.NoticeMessage;

/**
 * 通知型信息
 * @author zzxkj
 */
@Slf4j
@Component
@RabbitListener(queues = RabbitConfig.notice_queue)
public class NoticeMessageHandler {
    @RabbitHandler
    public void handler(NoticeMessage message){
        log.info("mq 消费一条notice相关消息： {}", message.toString());
        switch (message.getType()){
            case NoticeMessage.NOTICE_FOR_COMMENT:
                //这里写通知逻辑
                break;
            default:
                log.error("没找到对应的消息类型，请注意！！ --》 message:{}", message.toString());
                break;
        }
    }
}
